﻿Public Class Gest_Ofer

    Public Function listar() As Collection
        Dim dao As New RestauranteDAO
        Return dao.listar()
    End Function

    Public Function insertar(ByVal idres As Integer, ByVal desc As String, ByVal fi As String, ByVal ff As String) As Oferta

        Dim modelo As New Oferta()
        modelo.Restaurante_idestaurant = idres
        modelo.descripcion = desc
        modelo.fecha_inicio = fi
        modelo.fecha_fin = ff

        Dim dao As New OfertaDAO
        Return dao.insertar(modelo)
    End Function

    Public Sub actualizar(ByVal desc As String, ByVal fi As String, ByVal ff As String, ByVal idof As Integer)

        Dim modelo As New Oferta()
        modelo.descripcion = desc
        modelo.fecha_inicio = fi
        modelo.fecha_fin = ff
        modelo.idOferta = idof

        Dim dao As New OfertaDAO
        dao.actualizar(modelo)
    End Sub

    Public Sub eliminar(ByVal idrestaurant As Integer)
        Dim dao As New RestauranteDAO
        dao.eliminar(idrestaurant)
    End Sub

    Public Function obtener(ByVal idrestaurant As Integer) As Oferta
        Dim dao As New OfertaDAO
        Return dao.obtener(idrestaurant)
    End Function

    Public Function obtener2(ByVal nombre As String) As todo
        Dim modelo As New todo
        modelo.nombre = nombre
        Dim dao As New OfertaDAO
        Return dao.obtener2(modelo)
    End Function

End Class
